package com.yk.anima.dao;

import com.github.pagehelper.Page;
import com.yk.anima.pojo.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    int deleteByPrimaryKey(Integer sId);

    int insert(ShoppingCart record);

    int insertSelective(ShoppingCart record);

    ShoppingCart selectByPrimaryKey(Integer sId);

    int updateByPrimaryKeySelective(ShoppingCart record);

    int updateByPrimaryKey(ShoppingCart record);


    ShoppingCart findByNum(@Param("name") String name,
                           @Param("cartAdminId") Integer cartAdminId,
                           @Param("animalId") Integer animalId, @Param("gender") String gender);


    int updateByNum(@Param("s_id") Integer sId,@Param("num") Integer num);

    List<ShoppingCart> findById(int cartAdminId);

    int deleteById(@Param("cart_admin_id") int cartAdminId, @Param("s_id") int sId);

    int clear(int cartAdminId);

    ShoppingCart findByCartAdminIdAndSId(@Param("cart_admin_id") int cartAdminId,@Param("s_id") int sId);

    int updateByNumAndPrice(@Param("s_id") Integer sId,@Param("num") Integer num,@Param("price") String cP);

    Page<ShoppingCart> findByName(@Param("name") String name);
}